package com.thyme.service;

import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.thyme.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

/**
 * @Author Thyme
 * @Date 2021/2/5 9:42
 * @Description TODO
 **/
@Service
public class UserMultipleSerice {

    @Autowired
    private UserService userService;

    @DSTransactional
    public int save(User user){
        userService.insert(user);
        //int a= 1/0;
       // user.setUuid(UUID.randomUUID().toString().replace("-",""));
        return userService.save(user);
    }

}
